package string;

public class StringStringBuilderDemo {
    public static void main(String[] args) {
//        StringBuffer builder1=new StringBuffer();
//        StringBuffer builder2=new StringBuffer("abc");
//
//        String str="abc";
//        StringBuffer builder3=new StringBuffer(str);
//        String  str2=builder3.toString();

        String str="好好学习Java";
        StringBuffer builder=new StringBuffer(str);
        builder.append(",为了找个好工作");
        System.out.println(builder);

        builder.replace(9,16,"为了世界和平");
        System.out.println(builder);


 builder.delete(0,8);
        System.out.println(builder);

        builder.insert(0,"活着");
        System.out.println(builder);




    }
}
